import { dangrous_style } from "utils/constants/globalconstant";
import { ActionBase, ActionBaseOfCreep } from "../ActionBase";

 

/**
 * 放置site Action
 */
export class ActionVisual  extends ActionBase<IActionCMD<"visualHostile">>
{
    public execute(action: IActionCMD<"visualHostile">): ActionCode 
    {
        const station = global.world.PollHostiles(action.arg.entity.name);
        if(station )
        {
            let notexist = true;
            for(let x in station.hostileDamageMap)
            {
                for(let y in station.hostileDamageMap[x])
                {
                    if(station.hostileDamageMap[x][y] )
                    {
                       
                        action.arg.entity?.visual.text(`88`,parseInt( x),parseInt(y),dangrous_style);
                        notexist = false;
                    }
                }
            }
            if(notexist)
            {
                action.arg.entity.log("info",`房间没有敌方单位`);
            }
        }
        else
        {
            action.arg.entity.log("warn",`找不到 敌方爬的缓存 `);
        }
        return 0;
    }
}